* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  display: flex;
  justify-content: center;
  padding: 20px;
}

.container {
  width: 600px;
  max-width: 95%;
  background: #ffffff;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

h1 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 2.5rem;
  color: #444;
}

form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

#todoinput {
  flex: 1;
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid #ccc;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.3s;
}

#todoinput:focus {
  border-color: #007bff;
}

#add {
  padding: 12px 20px;
  background-color: #007bff;
  color: #fff;
  border: none;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#add:hover {
  background-color: #0056b3;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: space-between;
}

.filters button {
  padding: 8px 12px;
  background: none;
  border: 2px solid #007bff;
  color: #007bff;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

.filters button.active,
.filters button:hover {
  background: #007bff;
  color: #fff;
}

#todolist {
  list-style: none;
}

.todo-item {
  display: flex;
  align-items: center;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
  transition: background 0.3s;
}

.todo-item:hover {
  background: #f0f8ff;
}

.todo-item.completed .text {
  text-decoration: line-through;
  color: #888;
}

.todo-item input[type="checkbox"] {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.text {
  flex: 1;
  font-size: 1rem;
}

.actions {
  display: flex;
  gap: 10px;
}

.actions button {
  border: none;
  background: none;
  color: #dc3545;
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.3s;
}

.actions button:hover {
  color: #a71d2a;
}

/* Responsive */
@media (max-width: 500px) {
  .container {
    padding: 20px;
  }
  h1 {
    font-size: 2rem;
  }
  form {
    flex-direction: column;
  }
  #add {
    width: 100%;
  }
}
